package net.xyz.dropitem;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;

public class PlayerCommand implements CommandExecutor  {
	@Override
	public boolean onCommand(CommandSender sender, Command cmd, String lable, String args[]) {
		if(lable.equalsIgnoreCase("dtm")){
			if(args.length>0){
				if(sender instanceof Player&&((Player)sender).hasPermission("admin.admin")){
					if(args[0].equalsIgnoreCase("reload")){
						DropItem.Config();
						sender.sendMessage("插件重载成功");
						return true;
						}
					}
				if(sender instanceof ConsoleCommandSender){
					if(args[0].equalsIgnoreCase("reload")){
						DropItem.Config();
						sender.sendMessage("插件重载成功");
						return true;
						}
					}
				}
			}
		return false;
	}
}
